package org.bocs.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import jakarta.annotation.Resource;
import org.bocs.dao.IndexImgDao;
import org.bocs.entity.IndexImg;
import org.bocs.service.BannerService;
import org.bocs.untils.ResultVo;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BannerServiceImpl implements BannerService {

    @Resource
    private IndexImgDao indexImgDao;

    @Override
    public ResultVo getBannerList() {
        QueryWrapper<IndexImg> objectQueryWrapper = new QueryWrapper<>();
        objectQueryWrapper.eq("status", 1).orderByAsc("seq");
        List<IndexImg> indexImgList = indexImgDao.selectList(objectQueryWrapper);
        return new ResultVo(200, "轮播图", indexImgList);
    }
}
